<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@taglib prefix="s" uri="/struts-tags"%>
 <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
			
			<div id="content_right_list">
				
				<s:if test="#request.foodList != null && #request.foodList.size() > 0">
					
					<table class="table table-bordered table-hover table-striped text-center">
						<tr>
							<th class="text-center">图书类别</th>
							<th class="text-center">图书名</th>
							<th class="text-center">摘要</th>
							<th class="text-center">租赁价格(元)</th>
							<th class="text-center">修改</th>
							<th class="text-center">删除</th>
						</tr>
						<s:iterator id="var_food" value="#request.foodList">
							<tr class="food_list_tr">
								<td>
									<s:iterator id="var_food_type" value="#var_food.foodTypes">
										<s:property value="#var_food_type.foodTypeName"/>&nbsp;
									</s:iterator>
								</td>
								<td class="food_name">${var_food.foodName }</td>
								<td class="food_summary">${var_food.foodSummary }</td>
								<td>${var_food.foodPrice }</td>
								<td>
									<button type="button"  onclick="modify_food(${var_food.foodId})" class="btn btn-success">
										<span class="glyphicon glyphicon-wrench">修改 </span>
									</button>
								</td>
								<td>
									<button type="button"  onclick="delete_food(${var_food.foodId})" class="btn btn-danger">
										<span class="glyphicon glyphicon-remove">删除</span>
									</button>
								</td>
							</tr>
						</s:iterator>
					</table>
						
						<ul class="pager">
							<s:if test="pager.curPage > 1">
								<li><a href="admin/index?pager.curPage=1&foodTypeId=${foodTypeId}">首页</a></li>
								<li><a href="admin/index?pager.curPage=${pager.curPage - 1 }&foodTypeId=${foodTypeId}">上一页</a></li>
							</s:if>
							<s:if test="pager.curPage < pager.pageCount ">
								<li><a href="admin/index?pager.curPage=${pager.curPage + 1 }&foodTypeId=${foodTypeId}">下一页</a></li>
								<li><a href="admin/index?pager.curPage=${pager.pageCount }&foodTypeId=${foodTypeId}">尾页</a></li>
							</s:if>
							<li><a>总共${pager.rowCount }记录,共${pager.curPage }/${pager.pageCount }页</a></li>
						</ul>
						
				</s:if>
				<s:else>
					<font color="red">抱歉，暂无图书信息!</font>
				</s:else>
				
			</div>
</body>
</html>